var config = require("./webpack.config.js");
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');


config.entry.app.unshift("webpack/hot/only-dev-server");
config.entry.app.unshift("webpack-dev-server/client?http://127.0.0.1:8080/");

var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
    contentBase: 'build/',
    publicPath: "/" // 配置访问路径为根目录，也就是http://127.0.0.1:8080/
});
server.listen(8080);